/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.factory.comport.helper.constants;

/**
 *
 * @author MinhLuan
 */
public class ModbusConstants {

    /**
     * The Modbus address of the Master board.
     */
    public static final byte DEVICE_ADDRESS = 0x10;    //The modbus address of the board
    /**
     * The Modbus request function code.
     */
    public static final byte MODBUS_REQUEST_FUNCTION_CODE = 0x03;
    /**
     * The Modbus request length of data per message calculated by the number of
     * int16_t value
     */
    public static final int MODBUS_REQUEST_LENGTH_OF_DATA = 0x0C;
    /**
     * The Modbus request message length
     */
    public static final int MOBUS_REQUEST_MESSAGE_LENGTH = 0x08;
    /**
     * The Modbus reply function code.
     */
    public static final byte MODBUS_REPLY_FUNCTION_CODE = 0x06;
    /**
     * The Modbus reply message length
     */
    public static final int MOBUS_REPLY_MESSAGE_LENGTH = 0x05 + (MODBUS_REQUEST_LENGTH_OF_DATA << 1);
    /**
     * The first data segment address.
     */
    public static final int DATA_ADDRESS_FOR_SEGMENT_1 = 0x30;
    /**
     * The first data segment address.
     */
    public static final int DATA_ADDRESS_FOR_SEGMENT_2 = 0x3C;
}
